package ${basePackage}.dao;

import java.util.List;

import org.springside.modules.orm.hibernate.Page;

import ${basePackage}.entity.${beanName};
import com.kingee.framework.base.IbatisDaoSupport;

public class ${beanName}DAO extends IbatisDaoSupport {
	private final static String NAME_SPACE="${beanName}";
	
	//修改对象
	 public int update(${beanName} entity){
	   return getSqlMapClientTemplateExt().update(NAME_SPACE+".update", entity);
	 }

	//插入对象
	 public void insert(${beanName} entity){
		getSqlMapClientTemplateExt().insert(NAME_SPACE+".insert", entity);
	 }

	//删除对象
	 public int deleteByPrimaryKey(String id){
	   return getSqlMapClientTemplateExt().delete(NAME_SPACE+".deleteByPrimaryKey", id);
	 }

	//获取单个对象
	 public ${beanName} selectByPrimaryKey(String id){
	  return (${beanName})getSqlMapClientTemplateExt().queryForObject(NAME_SPACE+".selectByPrimaryKey", id);
	 }

	//查询已分页对象返回
	 public Page<${beanName}> findAllPage(Page<${beanName}> page, ${beanName} entity){
	  return getSqlMapClientTemplateExt().queryForPage(NAME_SPACE+".findAll",page, entity);
	 }

	//查询已list对象返回
	 public List<${beanName}> findAllList(${beanName} entity){
	  return getSqlMapClientTemplateExt().queryForList(NAME_SPACE+".findAll", entity);
	 }
}